package com.lfx.concurrent;

import java.util.concurrent.LinkedBlockingQueue;

public class LinkedBlockingQueueRequestQueue {

    private final LinkedBlockingQueue<Request> queue = new LinkedBlockingQueue<>();


    public Request getRequest(){
        Request request=null;
        try {
            request = queue.take();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return request;
    }


    public void put(Request request){
        try {
            queue.put(request);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

    }
}
